import { defineConfig } from 'electron-vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

export default defineConfig({
  main: {
    build: {
      rollupOptions: {
        external: [
          'fluent-ffmpeg',
          '@ffmpeg-installer/ffmpeg',
          '@ffprobe-installer/ffprobe',
          'node-video-thumbnail'
        ]
      }
    }
  },
  preload: {
    build: {
      rollupOptions: {
        external: ['electron']
      }
    }
  },
  renderer: {
    root: resolve('src/renderer'),
    publicDir: resolve('public'),
    build: {
      rollupOptions: {
        input: {
          main: resolve('src/renderer/index.html')
        }
      }
    },
    plugins: [vue()],
    assetsInclude: ['**/*.jpg', '**/*.jpeg', '**/*.png'],
    base: './',
    resolve: {
      alias: {
        '@': resolve('src/renderer/src'),
        '@assets': resolve('src/renderer/assets')
      }
    }
  }
}) 